export const fetchTopRank = async (cnt = 3) => {
    const reg = RegExp('概念$|概念股$', 'gi');
    const resp = await fetch(
        'https://apphq.longhuvip.com/w1/api/index.php?Index=0&Order=1&PhoneOSNew=2&Type=1&VerSion=5.7.0.15&ZSType=7&a=RealRankingInfo&apiv=w31&c=ZhiShuRanking&st=20'
    );
    const data = await resp.json();
    const data_list = data['list'] || [];
    const ranks = data_list.map((el, idx) => el[1]?.replace(reg, ''));
    if (ranks.length === 0) return [];
    return ranks.slice(0, cnt);
};

